<template>
  <div class="index">
    <el-container>
      <el-aside width="150px">
        <el-menu
          active-text-color="#acda00"
          default-active="/index/business"
          class="el-menu-vertical-demo"
          @select="handleSelect"
        >
          <div class="logo">考勤管理</div>
          <el-menu-item index="/index/goout">
            <span>出差申请</span>
          </el-menu-item>
          <el-menu-item index="/index/field">
            <span>外勤打卡</span>
          </el-menu-item>
          <el-menu-item index="/index/leave">
            <span>请假申请</span>
          </el-menu-item>
          <el-menu-item index="/index/work">
            <span>加班申请</span>
          </el-menu-item>
        </el-menu>
      </el-aside>

      <!-- 占位组件 -->
      <router-view></router-view>
    </el-container>
  </div>
</template>

<script setup>
import { useRouter } from "vue-router";
var $router = useRouter();

var handleSelect = (index) => {
  console.log(index);
  $router.push(index);
};
</script>

<style lang="scss" scoped>
.index {
  .logo {
    line-height: 50px;
    margin-left: 50px;
    font-weight: 700;
  }
}
</style>